- Because we are deploying with Netlify we can easily deploy a form to collect user Feedback.
- We're creating a FeedbackForm component
JS
function FeedbackForm() {return (<form name="feedback" method="post" data-netlify="true" action="/thankyou"><input type="hidden" name="form-name" value="feedback" /><p><label>Your name:<br /><input type="text" name="name" /></label></p><p><label>Feedback:<br /><textarea name="message" /></label></p><p><button type="submit">Send</button></p></form>);}export { FeedbackForm };
- Important thing to note, the data-netlify='true' helps Netlify's bots know to use this form. 📜 Netlify Form Documentation
- Because we're using a static site we have to include a hidden input 📜 Netlify Blog on Forms with Static Site Generators
- The action property will take the user to that page after they press the button. Create a page at /thankyou to customize the thank you message.
- Netlify collects the feedback from these forms and you can export the data as a CSV
- 💡 How could you adjust this form to collect emails for your newsletter?
Change a site name in Netlify
- With Netlify there are two main ways of changing the domain name.
- You can change the site name (free but will end in .netlify.app)
- Or you can use a custom domain that you've purchased.
- 📜 Netlify Docs on Custom Domains